{% extends 'org_detail_base.html' %}

{% load staticfiles %}

{% block title %}
    授课机构 - 首页
{% endblock %}

{% block org_detail_right %}
    <div class="right companycenter layout grouping">
        <div class="head">
            <h1>经典课程</h1>
            <a class="green fr more" href="{% url 'org:org_course' course_org.id %}">查看更多 > </a>
        </div>
        <div class="brief group_list">

            {% for course in all_courses %}
                <div class="module1_5 box">
                    <a href="{% url 'course:detail' course.id %}"><img width="214"
                                                                       src="{{ MEDIA_URL }}{{ course.image }}"/></a>
                    <div class="des">
                        <a href="{% url 'course:detail' course.id %}"><h2>{{ course.name }}</h2></a>
                        <span class="fl">课时：<i class="key">{{ course.learn_times }}</i></span>
                        <span class="fr">参加人数：{{ course.student_nums }}</span>
                    </div>
                    <div class="bottom">
                        <span class="fl">{{ course.course_org.name }}</span>
                        <span class="star fr  notlogin" data-favid="13" data-fav-type="4">
                                    {{ course.fav_nums }}
                                </span>
                    </div>
                </div>
            {% endfor %}

        </div>
    </div>
    <div class="right companycenter layout">
        <div class="head">
            <h1>机构教师</h1>
            <a class="green fr more" href="{% url 'org:org_teacher' course_org.id %}">查看更多 > </a>
        </div>

        {% for teacher in all_teachers %}
            <div class="diarys">
                <div class="module5 share company-diary-box" style="padding:10px 0;">
                    {# 教师名 #}
                    <div class="left">
                        <a href="{% url 'org:teacher_detail' teacher.id %}">
                            <img class="pic" src="{{ MEDIA_URL }}{{ teacher.image }}"/>
                            <p>{{ teacher.name }}</p>
                        </a>
                    </div>
                    {# 教师课程 #}
                    <div class="right">
                        {# 老师无课程展示 #}
                        {% if not teacher.hot_course %}
                            <div class="top">
                                <div class="fl">
                                    <h1>这个老师还没有发布课程噢</h1>
                                </div>
                            </div>
                            {# 展示学习人数最多的课程 #}
                        {% else %}
                            <div class="top">
                                <div class="fl">
                                    <a href="{% url 'course:detail' teacher.hot_course.id %}">
                                        <h1>{{ teacher.hot_course.name }}</h1></a>
                                    <span>发表于：{{ teacher.hot_course.add_time.date }}</span>
                                </div>
                            </div>
                            <div class="middle" style="border-bottom:0;">{{ teacher.hot_course.desc }}</div>
                        {% endif %}
                    </div>
                </div>
            </div>
        {% endfor %}

    </div>
    <div class="right companycenter layout">
        <div class="head">
            <h1>机构介绍</h1>
            <a class="green fr more" href="{% url 'org:org_desc' course_org.id %}">查看更多 ></a>
        </div>
        <div class="cont">
            {{ course_org.desc }}
        </div>
    </div>
{% endblock %}